<template>
  <div class="float-contact">
    <div class="contact-item wechat-item" @mouseenter="showQr = true" @mouseleave="showQr = false">
      <img src="/static/icons/wechat.svg" alt="微信" class="contact-icon" />
      <div class="contact-label">微信咨询</div>
      <div v-if="showQr" class="wechat-qr-popup">
        <img src="/static/images/wechat-qr.png" alt="微信二维码" class="qr-img" />
        <div class="qr-tip">微信扫码咨询</div>
      </div>
    </div>
    <div class="contact-item">
      <img src="/static/icons/phone.svg" alt="电话" class="contact-icon" />
      <div class="contact-label">电话联系</div>
    </div>
    <div class="contact-item">
      <img src="/static/icons/demo.svg" alt="演示" class="contact-icon" />
      <div class="contact-label">预约演示</div>
    </div>
  </div>
</template>
<script setup lang="ts">
import { ref } from 'vue'
const showQr = ref(false)
</script>
<style scoped>
.float-contact {
  position: fixed;
  top: 50%;
  right: 32px;
  transform: translateY(-50%);
  width: 80px;
  background: #fff;
  border-radius: 32px;
  box-shadow: 0 4px 24px 0 rgba(100,108,255,0.08);
  border: 2px solid rgba(100, 108, 255, 0.18); /* 半透明有色边框 */
  backdrop-filter: blur(2px); /* 朦胧感 */
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 0;
  z-index: 9999;
}
.contact-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 14px 0;
  cursor: pointer;
  user-select: none;
}
.contact-icon {
  width: 26px;  /* 图标略小 */
  height: 26px;
  margin-bottom: 4px;
}
.contact-label {
  font-size: 13px;
  color: #222;
  letter-spacing: 0.5px;
}

.wechat-qr-popup {
  position: absolute;
  left: -170px;
  top: 50%;
  transform: translateY(-50%);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 24px 0 rgba(100,108,255,0.15);
  border: 1.5px solid rgba(100, 108, 255, 0.18);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 120px;
  z-index: 10;
  animation: fadeInLeft 0.18s;
}
.qr-img {
  width: 90px;
  height: 90px;
  border-radius: 8px;
  margin-bottom: 6px;
}
.qr-tip {
  font-size: 12px;
  color: #666;
}
@keyframes fadeInLeft {
  from { opacity: 0; transform: translate(-30px, -50%);}
  to   { opacity: 1; transform: translateY(-50%);}
}
</style>